
 
#include "uiCommand.h"
#include <stdio.h>

int main() {
    
    printf("--------------------\n");
    printf("   uiCommandTest \n");

    uiCommand uiC, uiCres;
    bufferQue tmp;
    int res;

    // printBufferQue(tmp);
    // printUICMD(uiC);
    // printUICMD(uiCres);
    
    int x,y,z,v;
    x = 265;
    y = (x >> 8) & 0xFF;
    z = (x) & 0xFF;
    v = (y << 8) | z;
    
    printf("%d - %d %d - %d\n",x,y,z,v);

    // ------------------------------------------------------------
    uiC = makeUICMD (TEST_Q, 0, 0, 0, 0, 0, 0);
    tmp =  makeBQue ( uiC );
    uiCres = parseBQue ( tmp ); 
    
    res = isUICMDSame (uiC , uiCres);
    printf("TEST_Q ParseReparseTest: %s\n", res?"SUCCESS":"FAILED");
    
    // ------------------------------------------------------------
    uiC = makeUICMD (OK_A, 0, 0, 0, 0, 0, 0);
    tmp =  makeBQue ( uiC );
    uiCres = parseBQue ( tmp ); 
    
    res = isUICMDSame (uiC , uiCres);
    printf("OK_A ParseReparseTest: %s\n", res?"SUCCESS":"FAILED");
    
        
    // ------------------------------------------------------------
    uiC = makeUICMD (NNETW_Q, 0, 0, 0, 0, 0, 0);
    tmp =  makeBQue ( uiC );
    uiCres = parseBQue ( tmp ); 
    
    res = isUICMDSame (uiC , uiCres);
    printf("NNETW_Q ParseReparseTest: %s\n", res?"SUCCESS":"FAILED");
    
        
    // ------------------------------------------------------------
    uiC = makeUICMD (NNETW_A, 2, 0, 0, 0, 0, 0);
    tmp =  makeBQue ( uiC );
    uiCres = parseBQue ( tmp ); 
    
    res = isUICMDSame (uiC , uiCres);
    printf("NNETW_A ParseReparseTest: %s\n", res?"SUCCESS":"FAILED");
         
         
    // ------------------------------------------------------------
    uiC = makeUICMD (SETPID_Q, 35,  40,  50, 0, 0, 0);
    tmp =  makeBQue ( uiC );
    uiCres = parseBQue ( tmp ); 
    
    res = isUICMDSame (uiC , uiCres);
    printf("SETPID_Q ParseReparseTest: %s\n", res?"SUCCESS":"FAILED");
    
    
    // ------------------------------------------------------------
    uiC = makeUICMD (NETW_Q, 2,  0,  0, 0, 0, 0);
    tmp =  makeBQue ( uiC );
    uiCres = parseBQue ( tmp ); 
    
    res = isUICMDSame (uiC , uiCres);
    printf("NETW_Q ParseReparseTest: %s\n", res?"SUCCESS":"FAILED");
    
    // ------------------------------------------------------------
    uiC = makeUICMD (NETW_A, 2,  46,  0, 0, 0, 0);
    tmp =  makeBQue ( uiC );
    uiCres = parseBQue ( tmp ); 
    
    res = isUICMDSame (uiC , uiCres);
    printf("NETW_A 1 ParseReparseTest: %s\n", res?"SUCCESS":"FAILED");
    
    // ------------------------------------------------------------
    uiC = makeUICMD (NETW_A, 2,  346,  0, 0, 0, 0);
    tmp =  makeBQue ( uiC );
    uiCres = parseBQue ( tmp ); 

    res = isUICMDSame (uiC , uiCres);
    printf("NETW_A 2 ParseReparseTest: %s\n", res?"SUCCESS":"FAILED");
    
    // ------------------------------------------------------------
    uiC = makeUICMD (PDATA_Q, 1,  123,  0, 0, 0, 0);
    tmp =  makeBQue ( uiC );
    uiCres = parseBQue ( tmp ); 
    
    res = isUICMDSame (uiC , uiCres);
    printf("PDATA_Q 1 ParseReparseTest: %s\n", res?"SUCCESS":"FAILED");
    
    // ------------------------------------------------------------
    uiC = makeUICMD (PDATA_Q, 2,  567,  0, 0, 0, 0);
    tmp =  makeBQue ( uiC );
    uiCres = parseBQue ( tmp ); 
    
    res = isUICMDSame (uiC , uiCres);
    printf("PDATA_Q 2 ParseReparseTest: %s\n", res?"SUCCESS":"FAILED");
    
    // ------------------------------------------------------------
    uiC = makeUICMD (PDATA_A, 123,  56,  1, 95, 90, 63);
    tmp =  makeBQue ( uiC );
    uiCres = parseBQue ( tmp ); 
    
    res = isUICMDSame (uiC , uiCres);
    printf("PDATA_A ParseReparseTest: %s\n", res?"SUCCESS":"FAILED");
    
    // ------------------------------------------------------------
    uiC = makeUICMD (SYST_ON, 0, 0, 0, 0, 0, 0);
    tmp =  makeBQue ( uiC );
    uiCres = parseBQue ( tmp ); 
    
    res = isUICMDSame (uiC , uiCres);
    printf("SYST_ON ParseReparseTest: %s\n", res?"SUCCESS":"FAILED");
    
    // ------------------------------------------------------------
    uiC = makeUICMD (SYST_OFF, 0, 0, 0, 0, 0, 0);
    tmp =  makeBQue ( uiC );
    uiCres = parseBQue ( tmp ); 
    
    res = isUICMDSame (uiC , uiCres);
    printf("SYST_OFF ParseReparseTest: %s\n", res?"SUCCESS":"FAILED");
    
    
    // ------------------------------------------------------------
    uiC = makeUICMD (SETMODE_Q, 250, 0, 0, 0, 0, 0);
    tmp =  makeBQue ( uiC );
    uiCres = parseBQue ( tmp ); 

    res = isUICMDSame (uiC , uiCres);
    printf("SETMODE_Q ParseReparseTest: %s\n", res?"SUCCESS":"FAILED");
    
    // ------------------------------------------------------------
    uiC = makeUICMD (SETMODE_A, 1, 0, 0, 0, 0, 0);
    tmp =  makeBQue ( uiC );
    uiCres = parseBQue ( tmp ); 
    
    res = isUICMDSame (uiC , uiCres);
    printf("SETMODE_A ParseReparseTest: %s\n", res?"SUCCESS":"FAILED");
    
        // ------------------------------------------------------------
    uiC = makeUICMD (GETNMODE_Q, 0, 0, 0, 0, 0, 0);
    tmp =  makeBQue ( uiC );
    uiCres = parseBQue ( tmp ); 
    
    res = isUICMDSame (uiC , uiCres);
    printf("GETNMODE_Q ParseReparseTest: %s\n", res?"SUCCESS":"FAILED");
    
    // ------------------------------------------------------------
    uiC = makeUICMD (GETNMODE_A, 4, 0, 0, 0, 0, 0);
    tmp =  makeBQue ( uiC );
    uiCres = parseBQue ( tmp ); 
    
    res = isUICMDSame (uiC , uiCres);
    printf("GETNMODE_A ParseReparseTest: %s\n", res?"SUCCESS":"FAILED");
    
    
    
    

// NNETW_Q 6 
// NNETW_A 8

// SETPID_Q  

// SYST_ON 12
// SYST_OFF  

// NETW_Q  20
// NETW_A  22

// PDATA_A 24
// PDATA_Q 26

// GETMODE_Q 
// GETMODE_A 

// GETNMODE_Q
// GETNMODE_A
    
    return 0;
}

